<?php
session_start();
$mod_title="игра-меню GM-а";
$mod_status="on";
if($mod_status=="on")
{
function mod_body($auth,$adminauth)
{
$level="";
$guildc="";
$arenac="";
if($auth=="ok")
{
$mcl="";
$perms="";
$query = "SELECT * FROM users WHERE login='$_COOKIE[login]'";
$cat = mysql_query ($query);
if(!$cat) exit (mysql_error());
while(list($id,$login,$pass,$mail,$reg,$class,$m,$h,$z,$s,$mon,$gold,$pms,$lvl,$ava,$ban,$online) = mysql_fetch_row($cat))
{
$mcl=$class;
$level=$lvl;
$perms=$pms;
}
$query = "SELECT * FROM count";
$cat = mysql_query ($query);
if(!$cat) exit (mysql_error());
while(list($id,$guild,$arena) = mysql_fetch_row($cat))
{
$guildc=$guild;
$arenac=$arena;
}
echo "
<img src='img/bo.png'> <a href='?do=game/char'>персонаж($level)</a>|<img src='img/bs.png'> <a href='?do=game/history'>история</a><br>
<br>
";
$_pg="0";
$ag="-10";
$_pg2="10";
if(!empty($_GET['_pg']))
{
$ag=$_GET['_pg']-"10";
$_pg=$_GET['_pg'];
$_pg2=$_GET['_pg']+"10";
}
if($perms=="100")
{
if(empty($_GET['dox']))
{
echo "
<form method='POST' action='?do=game/gm/gift&dox=go' enctype='multipart/form-data'>
имя подарка:<br>
<input type='text' name='name' size='15'><br>
серебро:<br>
<input type='text' name='mon' size='15' value='0'><br>
золото:<br>
<input type='text' name='gold' size='15' value='1'><br>
скин подарка:<br>
<input type='file' name='file'><br>
<input type='submit' value='добавить подарок'><br>
</form>
<br>
";
}
else
{
$rndx=rand();
if(copy($_FILES['file']['tmp_name'],"img/gifts/$rndx".$_FILES['file']['name']))
{
$fname=$_FILES['file']['name'];
include "data/resize.php";
$path="img/gifts/$rndx$fname";
$size = getimagesize ("img/gifts/$rndx$fname");
$img_w=$size[0];
$img_h=$size[1];
$kaficent="";
if($img_w>$img_h)
{
$kaficent=$img_w/$img_h;
$img_w="40";
$img_h=$img_w/$kaficent;
}
else
{
$kaficent=$img_h/$img_w;
$img_h="40";
$img_w=$img_h/$kaficent;
}
$image = new SimpleImage();
$image->load("img/gifts/$rndx$fname");
$image->resize($img_w,$img_h);
$image->save("img/gifts/$rndx$fname");
$query = "INSERT INTO gifts (img,name,mon,gold) VALUES ('$rndx$fname','$_POST[name]','$_POST[mon]','$_POST[gold]')";
$result = mysql_query ($query)
or die ("<span style='color:red'>ошибка!</span>");
echo "<span style='color:green'>подарок добавлен!</span><br>";
}
else
{
echo "ошибка загрузки skina!<br>";
}
}
}
else
{
echo "Вы не администратор!<br>";
}
include "data/buttons.auth.php";
}
else
{
echo "
Ошибка авторизации!<br>
";
}
}
}
else
{
function mod_body($auth,$adminauth)
{
echo "мод выключен администратором!<br>";
}
}
?>